package com.ewanghuiju.app.test.bean;

import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;

import com.ewanghuiju.app.R;
import com.ewanghuiju.app.app.App;
import com.ewanghuiju.app.component.ImageLoader;
import com.ewanghuiju.app.util.SystemUtil;
import com.wihaohao.PageGridView;

/**
 * @author sj  qq:751943509
 * @class describe
 * @time 2020/2/19
 */
public class MyPageGridBean implements PageGridView.ItemModel {
    private int id;
    //标题
    private String title;
    //图标
    private String img;
    private int status;   //0 home 更多  1 我的页面 必备工具

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public String getItemName() {
        return title;
    }

    @Override
    public void setIcon(ImageView imageView) {
//        imageView.setImageResource(R.mipmap.icon_taobao);
        imageView.getLayoutParams().width = SystemUtil.dp2px(45);
        imageView.getLayoutParams().height = SystemUtil.dp2px(45);
        if (TextUtils.isEmpty(img)) {
            imageView.setImageResource(R.mipmap.icon_taobao);
        } else {
            ImageLoader.load(App.getInstance(), img, imageView);
        }
    }

    @Override
    public void setItemView(View itemView) {
    }
}
